feat(ts): add TypeScript GCache package#137
Open
lan17 wants to merge 7 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #137 +/- ##
==========================================
- Coverage 97.47% 95.33% -2.14%
==========================================
Files 13 23 +10
Lines 673 1094 +421
Branches 0 121 +121
==========================================
+ Hits 656 1043 +387
- Misses 17 28 +11
- Partials 0 23 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ShuaiShao93
approved these changes
May 12, 2026
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a TypeScript sibling package for GCache under
packages/gcache-ts, published as@rungalileo/gcache, plus TypeScript CI and Codecov upload. It consolidates the previously stacked milestone PRs into one reviewable PR.Supersedes: #133, #134, #135, #136.
What changed
Package + CI
.github/workflows/typescript.yamlfor install/typecheck/test/build.packages/gcache-ts/coverage/lcov.infowith thegcache-tsflag.Local-only GCache MVP
gcache.enable(fn)/gcache.disable(fn)APIs backed by NodeAsyncLocalStorage.GCacheKey/GCacheKeyConfig.Redis TTL layer
createClient.Runtime config + rollout controls
cacheConfigProvidersupport with fallback to per-functiondefaultConfig.Observability + operational safety
prom-client, with custom registry/prefix and duplicate collector reuse.Targeted invalidation + watermarks
trackForInvalidationon cached functions.gcache.invalidate(keyType, id, { futureBufferMs }).{urnPrefix:keyType:id}#watermark.Testing
Tests are written in behavioral Given/When/Then style.
Validation run on the peak branch:
pnpm install --frozen-lockfilepnpm ts:gcache:typecheckpnpm ts:gcache:test— 47 tests, coverage: 97.05% statements / 92.62% branches / 98% functions / 97.27% linespnpm ts:gcache:buildIntentionally left for later
cachedObjectconvenience API